package com.chen.facemanager.design;


/**
 * @ClassName Robot
 * @Description
 * @Author Mr-CHEN
 * @Date 2019/8/26 15:01
 * @Version V1.0
 **/

public class Robot {

    private RobotListener listener;

    public void registerListener(RobotListener listener){
        this.listener = listener;
    }

    public void working(){
        if (listener != null){
            Even even = new Even(this);
            this.listener.working(even);
        }
        System.out.println("机器人开始工作...");
    }

    public void dancing(){
        if (listener != null){
            Even even = new Even(this);
            this.listener.dancing(even);
        }
        System.out.println("机器人开始跳舞...");
    }

}